﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.guide.actions {
    import flash.utils.*;

    public class GAWaitForTransactionOrGameMode extends GAWaitForTransaction {

        protected var m_gameMode:Class;

        override public function createFromXml(_arg1:XML):Boolean{
            var def:* = null;
            var modeClass:* = null;
            var gameMode:* = null;
            var xml:* = _arg1;
            def = checkAndGetElement(xml, "transaction");
            if (!def){
                return (false);
            };
            var className:* = String(def.@className);
            var count:* = int(def.@count);
            m_predicate = makeClassTestFn(className);
            if (count > 0){
                m_requiredSuccessCount = count;
            };
            try {
                modeClass = String(def.@mode);
                gameMode = getDefinitionByName(("GameMode." + modeClass));
                this.m_gameMode = (gameMode as Class);
            } catch(e:Error) {
                return (false);
            };
            return (true);
        }
        override public function update(_arg1:Number):void{
            super.update(_arg1);
            if ((Global.world.getTopGameMode() is this.m_gameMode)){
                m_seq.stop(true);
            };
        }

    }
}//package Modules.guide.actions 
